When an object, such as a file, program, folder, directory, etc., is initially written to a storage medium, such as a hard disk drive, the data is written to sequential blocks or bytes. However, as files, folders, programs, etc. are deleted, added, and moved to the storage medium, the storage controller may write the objects to non-contiguous blocks. For instance, when objects are deleted, the empty spaces left on the disk are subsequently filled with new objects. If contiguous empty space is not sufficient to store a new object, then the remainder of the object is written to a next available space in the storage medium, which may be non-contiguous to the space on the disk storing other parts of the object.
A file stored in non-contiguous locations on a disk is referred to as “fragmented”. File fragmentation has a negative impact on disk performance because the disk head must spend time seeking and moving to different non-contiguous locations to access all bytes of a requested file.
To address the problem of defragmentation, the Microsoft® Windows® operating system includes a disk defragmenter utility that a user invokes to defragment all files on a disk or logical partition. (Microsoft and Windows are registered trademarks of Microsoft Corporation). The defragmentation utility may run for many hours to defragment all files on a disk or partition having several gigabytes of data. Moreover, many computer users may not have knowledge of the defragmentation utility to use to optimize disk performance. Further, many users may be discouraged from running the utility because of the time needed to defragment a drive. Yet further, running the defragmentation utility requires substantial computational resources and can substantially degrade the performance of other programs the user is concurrently running.